<ion-header>
  <ion-navbar>
    <ion-title>打开外部链接</ion-title>
    <ion-buttons>
      <button ion-button (click)="dismiss()">
        <ion-icon name="arrow-back"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content padding>
  <ion-segment [(ngModel)]="chooseType" color="primary" (ionChange)="segmentChanged($event)">
    <ion-segment-button value="handle">
      所需插件
    </ion-segment-button>
    <ion-segment-button value="test">
      真机调试
    </ion-segment-button>
  </ion-segment>
  <div *ngIf="chooseType=='handle'">
    <ion-list>
    <ion-item-sliding *ngFor="let item of showArr">
      <ion-item>
          {{item.text}}
      </ion-item>
      <ion-item-options side="right">
          <button ion-button> {{item.tips}}</button>
        </ion-item-options>
    </ion-item-sliding>
    </ion-list>
    <textarea disabled rows="10">
import { BatteryStatus } from '@ionic-native/battery-status';
constructor(private batteryStatus: BatteryStatus) { }
const subscription = this.batteryStatus.onChange().subscribe(status => {
   console.log(status.level, status.isPlugged);
});
subscription.unsubscribe();
    </textarea>
  </div>
  <div *ngIf="chooseType=='test'">
    当前电量:{{batteryStatus.level}}%<br/>
    是否充电:{{batteryStatus.isPlugged}}
  </div>
</ion-content>
